﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OProjectList : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看, Permission.修改, Permission.新增, Permission.删除 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "OProjectList";
            }
        }
        #region 属性 (查询条件)


        protected string MachineType
        {
            get
            {
                return GetRequestValue<string>("MachineType","");

            }
        }

        protected string PName
        {
            get
            {
                return GetRequestValue<string>("PName","");
            }
        }

        

        protected override string orderField
        {
            get
            {
                return string.IsNullOrEmpty(base.orderField) ? "OrderIndex" : base.orderField;
            }
        }
        protected override string orderDirection
        {
            get
            {
                return string.IsNullOrEmpty(base.orderDirection) ? "Desc" : base.orderDirection;
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
        }

        protected void DataBind()
        {

            this.rpMenu.DataSource = OProjectController.GetPagination(MachineType, PName,pageNum, numPerPage, SQLSort, ref TotalCount);
            this.rpMenu.DataBind();

            this.AddLog(Permission.查看);
        }

        protected int GetNoCompleteNum(object 计划台数, object 已完成)
        {
            int x计划台数 = Convert.ToInt32(计划台数);
             int x已完成 =0;
             if (已完成 is DBNull)
                 return x计划台数;
            x已完成 = Convert.ToInt32(已完成);

            return x计划台数 - x已完成;
        }
    }
}